/*    */ package com.zimbra.cs.client.soap;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.soap.DomUtil;
/*    */ import com.zimbra.common.soap.MailConstants;
/*    */ import com.zimbra.common.soap.SoapParseException;
/*    */ import com.zimbra.cs.client.LmcBrowseData;
/*    */ import java.util.ArrayList;
/*    */ import java.util.Iterator;
/*    */ import org.dom4j.DocumentHelper;
/*    */ import org.dom4j.Element;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class LmcBrowseRequest
/*    */   extends LmcSoapRequest
/*    */ {
/*    */   private String mBrowseBy;
/*    */   
/* 36 */   public void setBrowseBy(String b) { this.mBrowseBy = b; }
/*    */   
/* 38 */   public String getBrowseBy() { return this.mBrowseBy; }
/*    */   
/*    */   protected Element getRequestXML() throws LmcSoapClientException {
/* 41 */     Element request = DocumentHelper.createElement(MailConstants.BROWSE_REQUEST);
/* 42 */     DomUtil.addAttr(request, "browseBy", this.mBrowseBy);
/* 43 */     return request;
/*    */   }
/*    */   
/*    */   protected LmcBrowseData parseBrowseData(Element bdElem) {
/* 47 */     LmcBrowseData bd = new LmcBrowseData();
/* 48 */     bd.setFlags(bdElem.attributeValue("h"));
/* 49 */     bd.setData(bdElem.getText());
/* 50 */     return bd;
/*    */   }
/*    */   
/*    */   protected LmcSoapResponse parseResponseXML(Element parentElem)
/*    */     throws SoapParseException, ServiceException, LmcSoapClientException
/*    */   {
/* 56 */     LmcBrowseResponse response = new LmcBrowseResponse();
/* 57 */     ArrayList bdArray = new ArrayList();
/* 58 */     for (Iterator ait = parentElem.elementIterator("bd"); ait.hasNext();) {
/* 59 */       Element a = (Element)ait.next();
/* 60 */       bdArray.add(parseBrowseData(a));
/*    */     }
/*    */     
/* 63 */     if (!bdArray.isEmpty()) {
/* 64 */       LmcBrowseData[] bds = new LmcBrowseData[bdArray.size()];
/* 65 */       response.setData((LmcBrowseData[])bdArray.toArray(bds));
/*    */     }
/*    */     
/* 68 */     return response;
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/client/soap/LmcBrowseRequest.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */